import axios from "./axios"


export default {

    // 房屋列表
    getHouseList: (data) => {
        return axios({
            method: "get",
            url: "manage/manage/house/toPage",
            params: {
                "pageNo": data.pageNo,
                "pageSize": data.pageSize,
                "master": data.master
            }
        })
    },

    // 添加或修改房屋信息
    addHouse: (data) => {
        return axios({
            method: "post",
            url: "manage/manage/house/addOrUpdate",
            data
        })
    },
    
    // 删除房屋信息
    deleteHouse: (id) => {
        return axios({
            method: "delete",
            url: "manage/manage/house/delete/" + id,
        })
    },

    // 删除文件
    deleteFile: (id) =>{
        return axios({
            method: "delete",
            url: "centre/centre/file/deleteFile/" + id,
        })
    },


    // 收费列表
    getChargeList: (data) => {
        return axios({
            method: "get",
            url: "manage/manage/charge/toPage",
            params: {
                "pageNo": data.pageNo,
                "pageSize": data.pageSize,
                "name": data.name,
                "id": data.id
            }
        })
    },

    // 添加或修改收费信息
    addCharge: (data) => {
        return axios({
            method: "post",
            url: "manage/manage/charge/addOrUpdate",
            data
        })
    },

    // 删除收费信息
    deleteCharge: (id) => {
        return axios({
            method: "delete",
            url: "manage/manage/charge/delete/" + id,
        })
    },

    // 设备列表
    getDeviceList: (data) => {
        return axios({
            method: "get",
            url: "manage/manage/device/toPage",
            params: {
                "pageNo": data.pageNo,
                "pageSize": data.pageSize,
                "deviceName": data.deviceName
            }
        })
    },

    deleteDevice: (id) => {
        return axios({
            method: "delete",
            url: "manage/manage/device/delete/" + id,
        })
    },

    addDevice: (data) => {
        return axios({
            method: "post",
            url: "manage/manage/device/addOrUpdate",
            data
        })
    },

    // 租赁
    getRentList: (data) => {
        return axios({
            method: "get",
            url: "manage/manage/rent/toPage",
            params: {
                "pageNo": data.pageNo,
                "pageSize": data.pageSize,
                "rentUser": data.rentUser
            }
        })
    },

    deleteRent: (id) => {
        return axios({
            method: "delete",
            url: "manage/manage/rent/delete/" + id,
        })
    },

    addRent: (data) => {
        return axios({
            method: "post",
            url: "manage/manage/rent/addOrUpdate",
            data
        })
    },

    // 导出信息
    outPut: (id) =>{
        return axios({
            method: "get",
            url: "manage/manage/rent/output/" + id,
        })
    },

    // 用户
    updateUser: (data) => {
        return axios({
            method: "post",
            url: "manage/manage/user/addOrUpdate",
            data
        })
    },

    getUsers: () =>{
        return axios({
            method: "get",
            url: "manage/manage/user/getUsers"
        })
    },

    getAllHouse: () =>{
        return axios({
            method: "get",
            url: "manage/manage/house/allHouse"
        })
    },

    isAble: (id) =>{
        return axios({
            method: "get",
            url: "manage/manage/user/isAble/" + id,
        })
    }
}